package utils

import (
	"order/model"
	"order/order"
)

func OrderModelToProto(o model.Order) *order.OrderData {
	return &order.OrderData{
		Id:        int32(o.ID),
		OrderNum:  o.OrderNum,
		UserId:    o.UserId,
		SumPrice:  o.SumPrice,
		Status:    o.Status,
		CreatedAt: o.CreatedAt.String(),
		UpdatedAt: o.UpdatedAt.String(),
		DeletedAt: o.DeletedAt.Time.Format("2006-01-02 15:04:05"),
	}
}
